package com.ejuornal.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ejuornal.bean.Role;
import com.ejuornal.dao.RoleDao;
import com.ejuornal.service.RoleService;

/**
 * @className:RoleServiceImpl.java
 * @decription:RoleService的实现类
 * @author:梁胜彬
 * @createDate:2013-1-26 下午3:25:09
 * @version:
 */
@Component("roleService")
public class RoleServiceImpl implements RoleService {
	private RoleDao roleDao;
	public void add(Role role) {
		String sql = "insert into t_role(roleId, roleName,roleDesc) values(?,?,?)";
		roleDao.add(sql, new Object[]{role.getRoleId(), role.getRoleName(),role.getRoleDesc()});
	}

	public void delete(int roleId) {
		// TODO Auto-generated method stub

	}

	public List<Role> findAll() {
		return roleDao.list();
	}

	public RoleDao getRoleDao() {
		return roleDao;
	}
	@Resource(name="roleDao")
	public void setRoleDao(RoleDao roleDao) {
		this.roleDao = roleDao;
	}

	@Override
	public boolean batchUpdate() {
		return roleDao.batchUpdate();
	}
	
}
